<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Knockout.js</title>

        <link rel="stylesheet" href="style.css" />
    </head>
    <body>
        <div id="root" class="root">
            <input type="checkbox" data-bind="checked:selector.isSelectAll" />
            <button type="button" data-bind="click:handleSelectedAllClick">
                全选
            </button>
            <button type="button" data-bind="click:handleUnselectAllClick">
                全不选
            </button>
            <button type="button" data-bind="click:handleInvertSelectClick">
                反选
            </button>

            <div class="list-tip">
                总共<span data-bind="text:selector.list().length">0</span
                >项，当前选中了
                <span data-bind="text:selector.selectedCount">0</span> 项
            </div>

            <ul data-bind="foreach:selector.list">
                <li>
                    <div class="list-item">
                        <input type="checkbox" data-bind="checked:isSelected" />
                        <span class="item-value" data-bind="text:text"></span>
                    </div>
                </li>
            </ul>
        </div>

        <script src="../scripts/lib/require.js" data-main="index.js"></script>
    </body>
</html>
